home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Examples / Set Name.as < prev    next >
Encoding:
Text File  |  1998-01-12  |  1.0 KB  |  25 lines  |  [TEXT/ToyS]

  1. property theNames : ["One", "Two", "Three", "Four", "Five", "Six", "Seven"]
  2.  
  3. dd install with grayscale -- font {name:"Espy Sans", size:12}
  4. set dlog to dd make dialog {size:[500, 120], contents:[¬
  5.     {class:pict, bounds:[0, 0, 500, 120], contents:128}, ¬
  6.     {class:push button, name:"OK", bounds:[20, 20, 120, 40]}, ¬
  7.     {class:push button, name:"Cancel", bounds:[140, 20, 240, 40]}, ¬
  8.     {class:push button, name:"Really Cancel", bounds:[300, 20, 410, 40]} ¬
  9.         ], name:"Change Name & Bounds", style:standard window}
  10.  
  11. set n to 1
  12. repeat
  13.     try
  14.         set dItem to dd interact with user for max ticks 20
  15.         if dItem = 4 then exit repeat --if you hit the "Really Cancel" button
  16.         dd set name of item 2 of dlog to (item n of theNames)
  17.         dd set name of item 3 of dlog to (current date)'s time string
  18.         dd set bounds of item 3 of dlog to [120 + n * 20, 12 + n * 8, 220 + n * 20, 32 + n * 8]
  19.         set n to (n mod (length of theNames)) + 1
  20.     on error --you can cancel with a command period if you're quick on the keys!
  21.         exit repeat
  22.     end try
  23. end repeat
  24. dd delete dlog
  25. dd uninstall